//
//  SWRegisterReq.swift
//  MissMedia
//
//  Created by linhan on 16/4/1.
//  Copyright © 2016年 Miss. All rights reserved.
//

import Foundation
class SWRegisterReq: SWBaseRequest
{
    var phone:String = ""
    var password:String = ""
    var verifyCode:String = ""
    var ssoTicket:String = ""
    
    override init()
    {
        super.init()
        options.authorize = false
        api = SWRequestAPI.Register
    }
    
    override var params:Any?
    {
        var param:[String:Any] = [:]
        param["phone"] = phone
        param["pwd"] = password
        param["vcode"] = verifyCode
        if ssoTicket.length > 0
        {
            param["register_token"] = ssoTicket
        }
        return param
    }
    
    override func JSONToModel(_ json:JSON, JSONString:String, JSONData:Data) -> AnyObject?
    {
        return Mapper<SWRegisterRsp>().map(JSONString: JSONString)
    }
    
}

class SWRegisterRsp: NSObject,Mappable
{
    var data:SWAuthDataRsp?
    
    required init?(map: Map) { }
    
    // Mappable
    func mapping(map: Map) {
        data    <- map["BaseModle"]
    }
}
